package test03;

public class PrintArray {
    public static void main(String[] args) {
        int arr[][]={{2,1,4}, {8,1,2,4,5},{1,2}};
        int maxLength=0;
        for(int i=0;i<arr.length;i++){
            if(maxLength<arr[i].length){
                maxLength=arr[i].length;
            }
        }
        for(int i=0;i<arr.length;i++){
            for(int j=0;j<arr[i].length;j++){
                System.out.print(arr[i][j]+" ");
            }
            for(int k=0;k<maxLength-arr[i].length;k++){
                System.out.print("X"+" ");
            }
            System.out.println();
        }
    }
}
